/**
 * Copyright 2012 Eliot Stock
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import java.io.Serializable;

/**
 * Google Analytics custom variable. See https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables
 */
public class AnalyticsCustomVariable implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	public enum Scope {
		VISITOR(1),
		SESSION(2),
		PAGE(3);
		
		private Integer index;
		
		Scope(Integer index) {
			this.index = index;
		}
		
		public Integer getIndex() {
			return this.index;
		}
	}

	private Integer index;
	
	private String name;
	
	private String value;
	
	private Scope scope;
	
	public AnalyticsCustomVariable(Integer index, String name, String value, Scope scope) {
		this.index = index;
		this.name = name;
		this.value = value;
		this.scope = scope;
	}

	public Integer getIndex() {
		return index;
	}

	public void setIndex(Integer value) {
		index = value;
	}

	public String getName() {
		return name;
	}

	public void setName(String value) {
		name = value;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Integer getScope() {
		return scope.getIndex();
	}

	public void setScope(Scope value) {
		scope = value;
	}
	
}
